import request from '@/utils/request.js'

export function getArticleList(page, size, searchParams) {
  return request.get('/article/list', {
    params: {
      page: page,
      size: size,
      title: searchParams?.title,
      name: searchParams?.name,
      startTime: searchParams?.searchTime[0],
      endTime: searchParams?.searchTime[1]
    }
  })
}

/**
 * 删除文章id
 * @param articleId
 */
export function remove(articleId) {
  return request.delete(`/article/remove/${articleId}`)
}

/**
 * 详情
 * @param articleId
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export function detail(articleId) {
  return request.get(`/article/detail/${articleId}`)
}
